<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       /*  input{
            color: #999;
        } */

       /*  input{
            color: #999;
        } */
       /*  div{
            width: 300px;
            height: 300px;
            background-color: aqua;
        }
        .a{
            color: burlywood;
            text-align: center;
            line-height: 300px;
            margin-top: 100px;
        } */
      /*   div{
            width: 300px;
            margin: 100px auto;
        }
        .a{
            display: inline-block;
            font-size: 12px;
            color: #999;
            /* background: url(./); */
            /* padding-left: 20px; */
       /*  }
        .b{
            color: red;
        }
.c{
    color: #11e711
} */
/* div{
    width: 300px;
    height: 300px;
    border: 1px solid #000;
}
span{
    display: block;
    width: 10px;
    height: 10px;
    border: 1px solid #000;
    line-height: 10px;
    text-align: center;
    float: right;
    cursor: pointer;
    
} */
         
    </style>
</head>
<body>
<input type="text" name="" id="" value="请输入">
<script>
    var inp=document.querySelector('input')
    inp.onfocus=function(){
        if(this.value==='请输入'){
            this.value=''
        }
inp.onblur=function(){
    if(this.value==="")
    this.value='请输入'
}
        
    }
</script>






    <!-- <div>
        京东
        <span>x</span>
    </div>
<script>
    var di=document.querySelector('div')
    var spn=document.querySelector('span')
    spn.onclick=function(){
      di.style.display='none'
    }
</script> -->
<!-- <div class="re">
    <input type="password" >
    <p class="a">请输入6~16位密码</p> -->
</div>
<script>
    /* var inp=document.querySelector('input')
    var p_1=document.querySelector('p')
    inp.onblur=function(){
        if(inp.value.length<6||inp.value.length>16){
            // console.log('错误');
          p_1.className='a b'
          p_1.innerHTML='位数不对'
        }else{
            p_1.className='a c'
          p_1.innerHTML='位数对'
        }
    } */
</script>














  <!--   <div>1234</div>
    <script>
        var di=document.querySelector('div')
        di.onclick=function(){
            this.style.backgroundColor='red'
            this.className='a'
        }
    </script> -->
<!-- <input type="text" value="手机">
<script>
    var inp=document.querySelector('input')
    inp.onfocus=function(){
        if(this.value==='手机'){
            this.value=''
        }
        this.style.color='#333'
    }
    inp.onblur=function(){
        if(this.value===''){
            this.value='手机'
        }
        this.style.color='#999'
    }
</script> -->








   <!--  <input type="text" value="手机">
    <script>
        var inp=document.querySelector('input')
        inp.onfocus=function(){
            // console.log('焦点');
            if(this.value==='手机'){
                this.value=''
            }
            this.style.color="#333"
        }
        inp.onblur=function(){
            // console.log("失去");
        if(this.value===''){
            this.value='手机'
        }
        this.style.color="#999"
        }
    </script> -->
</body>
</html>
